﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YJTTool.Core.Utilities;

namespace YJTTool.Core.Global
{
    public class GlobalApp : InheritBase
    {
        private static GlobalApp _instance;

        private static readonly object _lock = new object();

        public string UserName = "";

        /// <summary>
        /// 定时器可选时间
        /// </summary>
        public TimerTask TimerTimesList { get; set; }
        private GlobalApp()
        {
            Init();
        }
        public static GlobalApp Instance
        {
            get
            {
                // 确保线程安全
                lock (_lock)
                {
                    // 如果实例为空，则创建唯一实例
                    if (_instance == null)
                    {
                        _instance = new GlobalApp();
                    }
                    return _instance;
                }
            }
        }

        private void Init()
        {
            DataBaseType = new List<string>();
            TelematicsName = new List<string>();
            TimerTimesList = new TimerTask();
            DataBaseType.Add("SqlServer");
            DataBaseType.Add("SqLite");
            DataBaseType.Add("Oracle");
            TelematicsName.Add("向日葵远程控制");
            TelematicsName.Add("Mstsc");
            TelematicsName.Add("ToDesk");
            TelematicsName.Add("TeamViewer");
            TelematicsName.Add("帮我吧");
        }
        /// <summary>
        /// 数据库类型
        /// </summary>
        public List<string> DataBaseType { get; set; }

        /// <summary>
        /// 远程信息
        /// </summary>
        public List<string> TelematicsName { get; set; }


    }
}
